import {
  AutoIncrement,
  Column,
  DataType,
  Model,
  PrimaryKey,
  Table,
} from 'sequelize-typescript';

@Table({
  tableName: 'orders',
})
export class Orders extends Model {
  @PrimaryKey
  @AutoIncrement
  @Column({
    type: DataType.INTEGER,
    allowNull: false,
    comment: 'id',
  })
  id: number;

  @Column({
    type: DataType.STRING(100),
    comment: '订单号',
  })
  orderNum: string;

  @Column({
    type: DataType.STRING(100),
    comment: '平台订单号',
  })
  tradeNo: string;

  //用户名称
  @Column({
    type: DataType.INTEGER,
    comment: '用户id',
  })
  userId: number;

  @Column({
    type: DataType.DECIMAL(6, 2),
    comment: '',
  })
  amount: number;

  @Column({
    type: DataType.INTEGER,
    comment: '',
  })
  vipType: number;

  @Column({
    type: DataType.STRING(20),
    comment: '支付方式',
  })
  paymentMethod: string;

  @Column({
    type: DataType.INTEGER,
    comment: '支付状态',
  })
  status: number;

  @Column({
    type: DataType.STRING(100),
    comment: '描述',
  })
  desc: string;
}
